#include "CodeExercise.h"
#include "Operation.h"
#include <map>
/*
 *
 * $ ./Exercise input.csv output.csv Symbol,WeightedAveragePrice,MaxTimeGap
 * “WeightedAveragePrice=sum(Quantity*Price)/sum(Quantity)”
 * “MaxTimeGap=max(delta(TimeStamp))”


 */
int main(int argc, char* argv[])
{
    vector<string> vec;
    string input_file = argv[1];
    string output_file = argv[2];
    string format = argv[3];
    for (int i=4; i<argc; i++){
        string str = string(argv[i]);
        vec.push_back(str);
    }
    //将输入参数进行处理之后，传入Exercise对象中
    Exercise exercise(input_file, output_file, vec, format);
    //运行读取文件并更新数据的过程
    exercise.run();
    //将更新完成的数据写入文件
    exercise.write_to_file();
    return 0;
}
